﻿/*******************************************************************************
 * Copyright © 2017 FriendStar.Framework 版权所有
 * Author: FZH
 * Description: FriendStar快速开发平台
 * Website：http://www.FriendStar.cn
*********************************************************************************/
using System.Collections.Generic;
using FriendStar.Code;
using System.Data.SqlClient;
using FriendStar.Application.VBaseData;
using System.Text;
using System.Data;
using System;
using Aspose.CAD;
using Aspose.CAD.FileFormats.Cad;
using Aspose.CAD.ImageOptions;
using System.IO;

namespace FriendStar.Application.BaseData
{
    /// <summary>
	/// 设备档案对应的数据应用功能类。
	/// </summary>
	public class CommonApp
    {
        private Dictionary<string, string> sqlList = new Dictionary<string, string>();

        public CommonApp(string path)
        {
            StringBuilder outter = new StringBuilder();

            using (StreamReader sr = File.OpenText(path))
            {
                string temp = string.Empty;

                while (null != (temp = sr.ReadLine()))
                {
                    outter.AppendLine(temp);
                }
            }

            sqlList = outter.ToString().ToObject<Dictionary<string, string>>();
        }

        public string GetSQLByExport(string id)
        {
            string result = string.Empty;

            try
            {
                result = sqlList[id];
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

                result = string.Empty;
            }

            return result;
        }
    }
}




